/*
 * MediaChunkIndex.h
 *
 *  Created on: 2013-1-11
 *      Author: terry
 */

#ifndef MEDIACHUNKINDEX_H_
#define MEDIACHUNKINDEX_H_

#include "MediaFileFormat.h"
#include <vector>


struct MediaChunkIndex
{
    int64_t offset;
    MediaChunkHeader header;
};

typedef std::vector< MediaChunkIndex >  MediaChunkIndexArray;

class MediaChunkIndexTable : public MediaChunkIndexArray
{
public:
    MediaChunkIndexTable();
    ~MediaChunkIndexTable();

    int64_t getDuration();

    bool find(int64_t offset, MediaChunkIndex& index);

    bool parseFromFile(BYTE* buffer, int64_t length);

};



#endif /* MEDIACHUNKINDEX_H_ */
